const textElement = document.getElementById('dynamicText');
const texts = ["欢迎来到我的页面！", "这是一个动态文字示例！", "感谢您的访问！"];
let index = 0;

// function changeText() {
//     textElement.textContent = texts[index];
//     index = (index + 1) % texts.length;
// }

// setInterval(changeText, 3000); // 每3秒切换一次文字



function getUrlParams(url) {
    const reg = /(\w+)=([^&]+)/g;
    const params = {};
    let match;
    
    while ((match = reg.exec(url)) !== null) {
      params[match[1]] = match[2];
    }
    return params;
  }

function getCheck(fwm){
    var str=''

    console.log('getCheck=',fwm,"  ",'http://anjismart.com/mzc/ndlService.asmx/getaj?ucode='+fwm)

    // $.ajax({
    //     url:  'http://anjismart.com/mzc/ndlService.asmx/getaj?ucode='+fwm,
    //     type: 'get',
    //      dataType: 'jsonp', // 请求方式为jsonp
    //     crossDomain: true,
    //     success: function(data) {
    //         console.log('Response:', data);
    //         str=data
    //         return str;
    //     },
    //     data: {}
    //     });


        $.get('http://anjismart.com/mzc/ndlService.asmx/getaj', 
            { ucode: fwm }, 
            function(response) {
                console.log('请求成功:',  response);

                 if(response!=null){
                    const obj = JSON.parse(response);
                    console.log('请求成功2:',  obj[0].code);
                 textElement.textContent = obj[0].code;
                }
            
                str=response

                return str;
        });   

}
   
//   const url = 'https://www.example.com/?name=John&age=25';

const url = new URL(window.location.href);
console.log('url',url);
var data2= getUrlParams(url);
console.log('da2',data2);
var chek=getCheck(data2.fwm)
console.log('fwm',chek);



